package com.newasia.user.converter;

import com.newasia.user.dal.entitys.Areas;
import com.newasia.user.dto.AreaDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring")
public interface AreaConverter {

    @Mappings({
            @Mapping(source = "id",target = "id"),
            @Mapping(source = "parentId",target = "parentId"),
            @Mapping(source = "name",target = "name")
    })
    AreaDto address2List(Areas area);

    List<AreaDto> address2List(List<Areas> addresses);
}
